package com.lukstron.youko;

import java.util.Random;

public class HardwareSimulator extends Hardware {

	@Override
	public Boolean connect() {
		return true;
	}

	@Override
	public void disconnect() {
	}

	@Override
	public Boolean set(Datum datum) {
		return true;
	}

	@Override
	public void reset(Datum datum) {

	}

	@Override
	public String measureResistivity(int time) {
		_sleep();
		return "";
	}

	@Override
	public String measureInducePolarization(int time) {
		_sleep();
		return "";
	}

	@Override
	public Double measureBattery(int index) {
		_sleep();
		Random random = new Random();
		return (double) random.nextInt(100);
	}

	@Override
	public Boolean getCurrent() {
		_sleep();
		Random random = new Random();
		return random.nextBoolean();
	}

	@Override
	public Boolean getPotential() {
		_sleep();
		Random random = new Random();
		return random.nextBoolean();
	}

	@Override
	public Boolean test(Datum datum) {
		_sleep();
		Random random = new Random();
		return random.nextBoolean();
	}

	@Override
	public void reset() {
	}

	protected void _sleep() {
		try {
			Thread.sleep(500);
		} catch (InterruptedException e) {
		}
	}

}
